package fr.vvins.core.catalog.entity;

import java.io.Serializable;
import java.util.Set;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import fr.vvins.core.dao.EntityImpl;


/**
 * Country entity
 */
@Entity
@Table(schema="vvins",name="VV_COUNTRY")
public class Country extends EntityImpl implements Serializable {

	private static final long serialVersionUID = 6816364526642582638L;
	@Id
	@GeneratedValue
	@Column(name="id")
	private Integer id;
	
	@Basic
	@Column(name="name")
	private String name;

	@Basic
	@Column(name="code")
	private String code;
	
	@OneToMany(mappedBy="country")
	private Set<Region> regions;
	

	public Country() {
	}

	public Country(String name, String code) {
		this.name = name;
		this.code = code;
	}

	@Override
	public Integer getId() {
		return this.id;
	}

	@Override
	public void setId(Integer id) {
		this.id = id;
	}

	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getCode() {
		return this.code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public Set<Region> getRegions() {
		return regions;
	}

	public void setRegions(Set<Region> regions) {
		this.regions = regions;
	}


}
